<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMaterielTable extends Migration
{
  /**
   * 物料
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('materiel', function (Blueprint $table) {
      $table->increments('id');
      $table->unsignedSmallInteger('member_id')->comment('用户ID');
      $table->unsignedSmallInteger('type')->default(false)->comment('物料类型 0测试户 1正式户');
      $table->string('name', 50)->comment('物料名称');
      $table->string('overt_phone', 20)->comment('外显号码');
      $table->string('seat_phone', 20)->comment('坐席绑定号码');
      $table->unsignedSmallInteger('min_age')->comment('最小年龄');
      $table->unsignedSmallInteger('max_age')->comment('最大年龄');
      $table->unsignedSmallInteger('sex')->default(0)->comment('性别 0全部 1男 2女');
      $table->string('province', 30)->comment('省份');
      $table->string('city', 30)->comment('城市');
      $table->string('license', 255)->nullable()->comment('营业执照');
      $table->string('report', 255)->nullable()->comment('第三方报备单');
      $table->unsignedSmallInteger('status')->default(0)->comment('管理员物料审核状态 0审核中 1审核通过 2审核拒绝');
      $table->timestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::dropIfExists('materiel');
  }
}
